﻿#pragma once
#include <BaseCommand.h>
#include <GraphicsBoxItem.h>
#include <QPointF>
#include <QSizeF>
#include <QMap>

class ScaleCommand :public BaseCommand
{
public:
	ScaleCommand(GraphicsBaseItem* item,
		const GraphicsItemInfo& oldItemInfo,
		const QMap<GraphicsBaseItem*, GraphicsItemInfo>& oldChildInfo,
		const GraphicsItemInfo& newSizenewItemInfo,
		const QMap<GraphicsBaseItem*, GraphicsItemInfo>& newChildInfo);
	~ScaleCommand();
protected:
	void undo()override;
	void redo()override;
private:
	GraphicsBaseItem* m_item = nullptr;
	GraphicsItemInfo m_oldItemInfo;
	QMap<GraphicsBaseItem*, GraphicsItemInfo> m_oldChildInfoMap;
	GraphicsItemInfo m_newItemInfo;
	QMap<GraphicsBaseItem*, GraphicsItemInfo> m_newChildInfoMap;
};

